<template>
  <view style="padding: 0 20upx;">
    <rich-text :nodes="content_html"></rich-text>
  </view>
</template>

<script>
import {ruleTw_getListByCon} from "api/login/login"

export default {
  name: "agreement",
  data(){
    return{
      content_html: '', //内容
    }
  },
  methods: {
    pageInit(type) {
      ruleTw_getListByCon({type}).then(res => {
        console.log(res)
        if(res.data && res.data.content_html){
          res.data.content_html = res.data.content_html.replace(new RegExp(' style="" ', "g"), '');
          res.data.content_html = res.data.content_html.replace(/\<img/gi, '<img style="width:100%;height:auto; display: block;"');
          this.content_html = res.data.content_html;
        }
        uni.setNavigationBarTitle({
          title: res.data.title
        });
      })
    }
  },
  onLoad(e) {
    this.pageInit(e.type);
  }
}
</script>

<style scoped>

</style>
